package br.edu.com1263.dao;

import java.util.Collection;

import javax.persistence.Query;

import br.edu.com1263.model.Paradigma;

public class ParadigmaDAOImpl extends AbstractDAO implements ParadigmaDAO{
	
	public ParadigmaDAOImpl(){

}

	@Override
	public Paradigma consultar(Long id) {
		return manager.find(Paradigma.class, id);
	}

	@Override
	public Collection<Paradigma> consultarTodos() {
		Query query = manager.createQuery("SELECT p FROM Paradigma p");
		return query.getResultList();
	}

	@Override
	public void salvar(Paradigma paradigma) {
		manager.persist(paradigma);
		
	}

	@Override
	public void alterar(Paradigma paradigma) {
		manager.merge(paradigma);
		
	}
	

	@Override
	public void remover(Paradigma paradigma) {
		manager.remove(paradigma);
		
	}

}
